//
//  JGNavigationViewController.m
//  Netease_Project
//
//  Created by JJetGu on 15-6-18.
//  Copyright (c) 2015年 JJetGu. All rights reserved.
//

#import "JGNavigationViewController.h"
#import "JGNavigationBar.h"

@interface JGNavigationViewController ()

@end

@implementation JGNavigationViewController

+ (void)initialize
{
    UINavigationBar *appearance = [UINavigationBar appearance];
    
    // 设置导航栏背景
    [appearance setBackgroundImage:[UIImage imageNamed:@"top_navigation_background"] forBarMetrics:UIBarMetricsDefault];
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
     // 替换为自定义的导航栏(kvc的原理，如果不能修改系统的东西，我们可以用kvc去修改)
    [self setValue:[[JGNavigationBar alloc] init] forKeyPath:@"navigationBar"];
}

#pragma mark - 这个方法也是专门用来布局子控件（当控制器的view尺寸发生改变的时候会调用）
//- (void)viewDidLayoutSubviews{}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
